#pragma once


#include "RBTree.h"

namespace utocoo
{
	template <class K>
	class set
	{
		
		struct setKeyOfT
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};
	public:
		typedef typename RBTree<K,const K,setKeyOfT>::iterator iterator;
		iterator begin()
		{
			return _t.begin();
		}
		iterator end()
		{
			return _t.end();
		}
		bool Insert(const K& key)
		{
			return _t.Insert(key);
		}
		
	private:
		RBTree<K, const K,setKeyOfT> _t;
	};

	void test_set1()
	{
		set<int> t;
		int arr[] = { 4, 2, 6, 1, 3, 5, 15, 7, 16,14 };
		for (auto e : arr)
		{
			t.Insert(e);
		}
		set<int>::iterator it = t.begin();
		while (it != t.end())
		{
		
			cout << *it << endl;
			++it;
		}

	}
}